package com.sz.admin.ai.factory.embeddingFactory.entity;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.ai.document.Document;

import java.util.List;

/**
 * @描述:
 * @Author: TangYuan
 * @Date: 2025/2/24 17:57
 */
@Data
@NoArgsConstructor
public class EmbeddingHandlerRequestDTO {
    
    private String thirdPartyName;
    
    private String modelName;
    
    private String modelKey;
    
    private String fileName;
    
    private String fileId;
    
    private EmbeddingHandlerUser embeddingHandlerUser;

    private List<Document> documentList;
    
    
    public static Builder builder() {
        return new Builder();
    }
    
    private EmbeddingHandlerRequestDTO(Builder builder) {
        this.thirdPartyName = builder.thirdPartyName;
        this.modelName = builder.modelName;
        this.modelKey = builder.modelKey;
        this.fileId = builder.fileId;
        this.fileName = builder.fileName;
        this.embeddingHandlerUser = new EmbeddingHandlerUser(builder.userId, builder.knowledgeBaseId);
        this.documentList = builder.documentList;
    }
    
    public static class Builder {
        private String thirdPartyName;
        private String modelName;
        private String modelKey;
        private String fileId;
        private String fileName;
        private String userId;
        private String knowledgeBaseId;
        private List<Document> documentList;
        
        
        public Builder thirdPartyName(String thirdPartyName) {
            this.thirdPartyName = thirdPartyName;
            return this;
        }
        
        public Builder modelName(String modelName) {
            this.modelName = modelName;
            return this;
        }
        
        public Builder modelKey(String modelKey) {
            this.modelKey = modelKey;
            return this;
        }
        
        public Builder fileId(String fileId) {
            this.fileId = fileId;
            return this;
        }
        
        public Builder fileName(String fileName) {
            this.fileName = fileName;
            return this;
        }
        
        public Builder userId(String userId) {
            this.userId = userId;
            return this;
        }
        
        public Builder knowledgeBaseId(String knowledgeBaseId) {
            this.knowledgeBaseId = knowledgeBaseId;
            return this;
        }
        
        public Builder documentList(List<Document> documentList) {
            this.documentList = documentList;
            return this;
        }
        
        public EmbeddingHandlerRequestDTO build() {
            return new EmbeddingHandlerRequestDTO(this);
        }
    }
}
